<!DOCTYPE html>
<html>
<head>
<title>日志模板</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">
<script type="text/javascript">
	var dataGrid;
	var winWidth =  700;
	var winHeight = 500;
	var addTitle = "添加记录";
	var addUrl =  "/modules/system/logTemplate/logTemplateAddPage.html";
	var editTitle = "编辑记录";
	var editUrl =  "/modules/system/logTemplate/logTemplateEditPage.html";
	var addWinParmeters = "'{0}','"+addTitle+"',"+winWidth+","+winHeight+",'"+addUrl+"'";
	var delUrl ="/modules/system/logTemplate/deleteLogTemplate.html";
	$(function() {
		var editIndex = undefined;
		dataGrid = $('#dataGrid').datagrid({
			url : 'logTemplateList.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [ [ 			
			{ field : 'id', title: '编号', width: 50, sortable : true,fixed:true},
			{ field : 'type', title : '信息类型', width : 80, sortable : false,fixed:true,
				formatter:function(value, row, index){
					if(value == 1){
						return "资金日志";
					}else if(value == 2){
						return "合计日志";
					}else if(value == 3){
						return "会员日志";
					}else if(value == 4){
						return "站内信";
					}else if(value == 5){
						return "积分日志";
					}
					return "";
				}
			},
			{ field: 'logType', title: '日志类型', width:100, sortable:false},
			{ field: 'value', title: '模板信息',width:120},
			{ field: 'remark', title: '模板备注',width:100},
			{ field: 'nid', title: '模板类型', width: 100 }, 
			{ field : 'action', title : '操作', width :60,
				fixed:true,
				formatter : function(value, row, index) {
					var str = '';
					str += '<dl>';
					str += '<dt><a href="javascript:void(0);" onclick="$.fn.dataGridOptions.editFun('+row.id+',editTitle,winWidth,winHeight,editUrl);" title="'+editTitle+'">编辑</a><i class="iconfont">&#xe639;</i></dt>';
					str += '<dd><a href="javascript:void(0);" onclick="$.fn.dataGridOptions.deleteFun('+row.id+',delUrl);" title="删除">删除</a></dd>';
					str +=  '</dl>'
					return str;
				}
			} ] ],
			toolbar : '#toolbar',
			onDblClickRow : function(rowIndex, rowData){
				if(editIndex == undefined){
					$(this).datagrid('beginEdit', rowIndex);
					editIndex = rowIndex;
				}else{
					$(this).datagrid('endEdit', rowIndex);
				}
			},
			onAfterEdit : function(rowIndex, rowData, changes){
				
			}
		});
	});
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	信息类型：
	                <select name="type" class="type" >
	                 <option value="0" selected="selected">全部</option>
					 <option value="1">资金日志</option>
					 <option value="2">合计日志</option>
					 <option value="3">会员日志</option>
					 <option value="4">站内信</option>
					 <option value="5">积分日志</option>
	                </select>
	            	<a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a>
	                <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <div class="sRight">
				<a onclick="$.fn.dataGridOptions.addFun(-1,addTitle,winWidth,winHeight,addUrl);" href="javascript:void(0);" class="addBtn"><i class="iconfont">&#xe629;</i>添加</a>			
            </div>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>
